1 module directx.d3d11_3;
2 /*-------------------------------------------------------------------------------------
3 *
4 * Copyright (c) Microsoft Corporation
5 *
6 *-------------------------------------------------------------------------------------*/
7 
8 version(Windows):
9 version(Direct3D_11):
10 
11 public import directx.dxgi1_3;
12 public import directx.d3d11_2;
13 
14 alias DWORD D3D11_CONTEXT_TYPE;
15 enum : D3D11_CONTEXT_TYPE
16 {
17     D3D11_CONTEXT_TYPE_ALL      = 0,
18     D3D11_CONTEXT_TYPE_3D       = 1,
19     D3D11_CONTEXT_TYPE_COMPUTE  = 2,
20     D3D11_CONTEXT_TYPE_COPY     = 3,
21     D3D11_CONTEXT_TYPE_VIDEO    = 4
22 }
23 
24 alias DWORD D3D11_TEXTURE_LAYOUT;
25 enum : D3D11_TEXTURE_LAYOUT
26 {
27     D3D11_TEXTURE_LAYOUT_UNDEFINED      = 0,
28     D3D11_TEXTURE_LAYOUT_ROW_MAJOR      = 1,
29     D3D11_TEXTURE_LAYOUT_64K_STANDARD_SWIZZLE   = 2
30 }
31 
32 struct D3D11_TEXTURE2D_DESC1
33 {
34     UINT Width;
35     UINT Height;
36     UINT MipLevels;
37     UINT ArraySize;
38     DXGI_FORMAT Format;
39     DXGI_SAMPLE_DESC SampleDesc;
40     D3D11_USAGE Usage;
41     UINT BindFlags;
42     UINT CPUAccessFlags;
43     UINT MiscFlags;
44     D3D11_TEXTURE_LAYOUT TextureLayout;
45 }
46 
47 mixin(uuid!(ID3D11Texture2D1, "51218251-1E33-4617-9CCB-4D3A4367E7BB"));
48 extern (C++) interface ID3D11Texture2D1 : ID3D11Texture2D {
49     void GetDesc1(D3D11_TEXTURE2D_DESC1* pDesc);
50 }
51 
52 struct D3D11_TEXTURE3D_DESC1
53 {
54     UINT Width;
55     UINT Height;
56     UINT Depth;
57     UINT MipLevels;
58     DXGI_FORMAT Format;
59     D3D11_USAGE Usage;
60     UINT BindFlags;
61     UINT CPUAccessFlags;
62     UINT MiscFlags;
63     D3D11_TEXTURE_LAYOUT TextureLayout;
64 }
65 
66 mixin(uuid!(ID3D11Texture3D1, "0C711683-2853-4846-9BB0-F3E60639E46A"));
67 extern (C++) interface ID3D11Texture3D1 : ID3D11Texture3D {
68     void GetDesc1(D3D11_TEXTURE3D_DESC1* pDesc);
69 
70 }
71 
72 alias DWORD D3D11_CONSERVATIVE_RASTERIZATION_MODE;
73 enum : D3D11_CONSERVATIVE_RASTERIZATION_MODE
74 {
75     D3D11_CONSERVATIVE_RASTERIZATION_MODE_OFF   = 0,
76     D3D11_CONSERVATIVE_RASTERIZATION_MODE_ON    = 1
77 }
78 
79 struct D3D11_RASTERIZER_DESC2
80 {
81     D3D11_FILL_MODE FillMode;
82     D3D11_CULL_MODE CullMode;
83     BOOL FrontCounterClockwise;
84     INT DepthBias;
85     FLOAT DepthBiasClamp;
86     FLOAT SlopeScaledDepthBias;
87     BOOL DepthClipEnable;
88     BOOL ScissorEnable;
89     BOOL MultisampleEnable;
90     BOOL AntialiasedLineEnable;
91     UINT ForcedSampleCount;
92     D3D11_CONSERVATIVE_RASTERIZATION_MODE ConservativeRaster;
93 }
94 
95 mixin(uuid!(ID3D11RasterizerState2, "6fbd02fb-209f-46c4-b059-2ed15586a6ac"));
96 extern (C++) interface ID3D11RasterizerState2 : ID3D11RasterizerState1 {
97     void GetDesc2(D3D11_RASTERIZER_DESC2* pDesc);
98 }
99 
100 struct D3D11_TEX2D_SRV1
101 {
102     UINT MostDetailedMip;
103     UINT MipLevels;
104     UINT PlaneSlice;
105 }
106 
107 struct D3D11_TEX2D_ARRAY_SRV1
108 {
109     UINT MostDetailedMip;
110     UINT MipLevels;
111     UINT FirstArraySlice;
112     UINT ArraySize;
113     UINT PlaneSlice;
114 }
115 
116 struct D3D11_SHADER_RESOURCE_VIEW_DESC1
117 {
118     DXGI_FORMAT Format;
119     D3D11_SRV_DIMENSION ViewDimension;
120     union
121     {
122         D3D11_BUFFER_SRV Buffer;
123         D3D11_TEX1D_SRV Texture1D;
124         D3D11_TEX1D_ARRAY_SRV Texture1DArray;
125         D3D11_TEX2D_SRV1 Texture2D;
126         D3D11_TEX2D_ARRAY_SRV1 Texture2DArray;
127         D3D11_TEX2DMS_SRV Texture2DMS;
128         D3D11_TEX2DMS_ARRAY_SRV Texture2DMSArray;
129         D3D11_TEX3D_SRV Texture3D;
130         D3D11_TEXCUBE_SRV TextureCube;
131         D3D11_TEXCUBE_ARRAY_SRV TextureCubeArray;
132         D3D11_BUFFEREX_SRV BufferEx;
133     }
134 }
135 
136 mixin(uuid!(ID3D11ShaderResourceView1, "91308b87-9040-411d-8c67-c39253ce3802"));
137 extern (C++) interface ID3D11ShaderResourceView1 : ID3D11ShaderResourceView {
138     void GetDesc1(D3D11_SHADER_RESOURCE_VIEW_DESC1* pDesc1);
139 }
140 
141 struct D3D11_TEX2D_RTV1
142 {
143     UINT MipSlice;
144     UINT PlaneSlice;
145 }
146 
147 struct D3D11_TEX2D_ARRAY_RTV1
148 {
149     UINT MipSlice;
150     UINT FirstArraySlice;
151     UINT ArraySize;
152     UINT PlaneSlice;
153 }
154 
155 struct D3D11_RENDER_TARGET_VIEW_DESC1
156 {
157     DXGI_FORMAT Format;
158     D3D11_RTV_DIMENSION ViewDimension;
159     union
160     {
161         D3D11_BUFFER_RTV Buffer;
162         D3D11_TEX1D_RTV Texture1D;
163         D3D11_TEX1D_ARRAY_RTV Texture1DArray;
164         D3D11_TEX2D_RTV1 Texture2D;
165         D3D11_TEX2D_ARRAY_RTV1 Texture2DArray;
166         D3D11_TEX2DMS_RTV Texture2DMS;
167         D3D11_TEX2DMS_ARRAY_RTV Texture2DMSArray;
168         D3D11_TEX3D_RTV Texture3D;
169     }
170 }
171 
172 mixin(uuid!(ID3D11RenderTargetView1, "ffbe2e23-f011-418a-ac56-5ceed7c5b94b"));
173 extern (C++) interface ID3D11RenderTargetView1 : ID3D11RenderTargetView {
174     void GetDesc1(D3D11_RENDER_TARGET_VIEW_DESC1* pDesc1);
175 }
176 
177 struct D3D11_TEX2D_UAV1
178 {
179     UINT MipSlice;
180     UINT PlaneSlice;
181 }
182 
183 struct D3D11_TEX2D_ARRAY_UAV1
184 {
185     UINT MipSlice;
186     UINT FirstArraySlice;
187     UINT ArraySize;
188     UINT PlaneSlice;
189 }
190 
191 struct D3D11_UNORDERED_ACCESS_VIEW_DESC1
192 {
193     DXGI_FORMAT Format;
194     D3D11_UAV_DIMENSION ViewDimension;
195     union
196     {
197         D3D11_BUFFER_UAV Buffer;
198         D3D11_TEX1D_UAV Texture1D;
199         D3D11_TEX1D_ARRAY_UAV Texture1DArray;
200         D3D11_TEX2D_UAV1 Texture2D;
201         D3D11_TEX2D_ARRAY_UAV1 Texture2DArray;
202         D3D11_TEX3D_UAV Texture3D;
203     }
204 }
205 
206 mixin(uuid!(ID3D11UnorderedAccessView1, "7b3b6153-a886-4544-ab37-6537c8500403"));
207 extern (C++) interface ID3D11UnorderedAccessView1 : ID3D11UnorderedAccessView {
208     void GetDesc1(D3D11_UNORDERED_ACCESS_VIEW_DESC1* pDesc1);
209 }
210 
211 struct D3D11_QUERY_DESC1
212 {
213     D3D11_QUERY Query;
214     UINT MiscFlags;
215     D3D11_CONTEXT_TYPE ContextType;
216 }
217 
218 mixin(uuid!(ID3D11Query1, "631b4766-36dc-461d-8db6-c47e13e60916"));
219 extern (C++) interface ID3D11Query1 : ID3D11Query {
220     void GetDesc1(D3D11_QUERY_DESC1* pDesc1);
221 
222 }
223 
224 mixin(uuid!(ID3D11DeviceContext3, "b4e3c01d-e79e-4637-91b2-510e9f4c9b8f"));
225 extern (C++) interface ID3D11DeviceContext3 : ID3D11DeviceContext2 {
226     void Flush1(D3D11_CONTEXT_TYPE ContextType, HANDLE hEvent);
227     void SetHardwareProtectionState(BOOL HwProtectionEnable);
228     void GetHardwareProtectionState(BOOL* pHwProtectionEnable);
229 }
230 
231 mixin(uuid!(ID3D11Device3, "A05C8C37-D2C6-4732-B3A0-9CE0B0DC9AE6"));
232 extern (C++) interface ID3D11Device3 : ID3D11Device2 {
233     HRESULT CreateTexture2D1(
234         const(D3D11_TEXTURE2D_DESC1)* pDesc1,
235         const(D3D11_SUBRESOURCE_DATA)* pInitialData,
236         ID3D11Texture2D1* ppTexture2D);
237 
238     HRESULT CreateTexture3D1(
239         const(D3D11_TEXTURE3D_DESC1)* pDesc1,
240         const(D3D11_SUBRESOURCE_DATA)* pInitialData,
241         ID3D11Texture3D1* ppTexture3D);
242 
243     HRESULT CreateRasterizerState2(
244         const(D3D11_RASTERIZER_DESC2)* pRasterizerDesc,
245         ID3D11RasterizerState2* ppRasterizerState);
246 
247     HRESULT CreateShaderResourceView1(
248         ID3D11Resource pResource,
249         const(D3D11_SHADER_RESOURCE_VIEW_DESC1)* pDesc1,
250         ID3D11ShaderResourceView1* ppSRView1);
251 
252     HRESULT CreateUnorderedAccessView1(
253         ID3D11Resource pResource,
254         const(D3D11_UNORDERED_ACCESS_VIEW_DESC1)* pDesc1,
255         ID3D11UnorderedAccessView1* ppUAView1);
256 
257     HRESULT CreateRenderTargetView1(
258         ID3D11Resource* pResource,
259         const(D3D11_RENDER_TARGET_VIEW_DESC1)* pDesc1,
260         ID3D11RenderTargetView1* ppRTView1);
261 
262     HRESULT CreateQuery1(
263         const(D3D11_QUERY_DESC1)* pQueryDesc1,
264         ID3D11Query1* ppQuery1);
265 
266     void GetImmediateContext3(
267         ID3D11DeviceContext3* ppImmediateContext);
268 
269     HRESULT CreateDeferredContext3(
270         UINT ContextFlags,
271         ID3D11DeviceContext3* ppDeferredContext);
272 
273     void WriteToSubresource(
274         ID3D11Resource pDstResource,
275         UINT DstSubresource,
276         const(D3D11_BOX)* pDstBox,
277         const(void)* pSrcData,
278         UINT SrcRowPitch,
279         UINT SrcDepthPitch);
280 
281     void ReadFromSubresource(
282         void* pDstData,
283         UINT DstRowPitch,
284         UINT DstDepthPitch,
285         ID3D11Resource pSrcResource,
286         UINT SrcSubresource,
287         const(D3D11_BOX)* pSrcBox);
288 }